{% extends "basic/header.html" %}
{% block css %}
    <link href="/static/css/student/student.css" rel="stylesheet">
{% endblock %}
{% block body %}
      <div class="row m-row">
        <div class="col-sm-2 col-md-2 sidebar" id="teacleftsidebar">
          <ul class="nav nav-sidebar m-lsts-navlt">
            <li class="m-lst-navlt">
              <a href="javascript:void(0)">
                <img src="../..{{ request.user.avatar }}" alt="" class="u-headimg-left">
{#                <p class="u-name-navlt u-user-name">{{ request.user.username }}</p>#}
                <p class="u-name-navlt">{{ request.user.realname }}</p>
              </a>
            </li>
          </ul>
          <ul class="nav nav-sidebar m-navsidber-l">
            <li class="active"><a href="/teacher/home/">学生档案</a></li>
            <li><a href="/teacher/scalelist/?uid={{ uid }}">现场测评</a></li>
            <li><a href="javascript:void(0)">训练内容</a></li>
          </ul>
          {#version start#}
          <div class="m-version-wrap">
            <p class="u-version-num">Version  1.0.0</p>
            <p class="m-version-66nao">2016 <span class="u-icon-ver"></span>六六脑</p>
          </div>
        {#version end#}
        </div>
        <div class="col-sm-10 col-md-10 main m-main-basic">
          <div class="row placeholders m-wrap-basictop">
            <div class="col-xs-8 col-sm-8 placeholder m-top-basic">
                <div class="btn-group">
                    <span class="btn-group-btn">
                        <a class="btn u-uname-basic">{{ userdetail.realname  | slice:"-2:" }}</a>
                        <a href="javascript:void(0)" class="u-uinfo-top">
                            <span class="u-uname-1">{{ userdetail.realname }}</span>，
                            {% if userdetail.sex == 1 %}
                                女
                            {% elif userdetail.sex == 2 %}
                                男
                            {% else %}
                                其他
                            {% endif %}，
                            {{ userdetail.age }}岁
                        </a>
                    </span>
                </div>
            </div>
            <div class="col-xs-4 col-sm-4 placeholder f-align-r m-pad-40">
                <a class="btn btn-primary u-btn-testBasic u-btn-blue" href="/teacher/scalelist/?uid={{ uid }}">现场测评</a>
            </div>
          </div>
          <div class="row m-cont-navBasic">
              <div class="col-xs-2 col-sm-2 placeholder m-wrap-navBasic">
                  <ul class="nav nav-sidebar m-lsts-navBasic">
                    <li class="m-lst-side"><a href="/teacher/student/?uid={{ uid }}" class="u-a-navBasic">基本信息</a></li>
                    <li class="m-lst-side"><a href="/teacher/save/?uid={{ uid }}" class="u-a-navBasic">测评报告</a></li>
                    <li class="m-lst-side active"><a href="/teacher/collect/?uid={{ uid }}" class="u-a-navBasic">信息采集</a></li>
                  </ul>
              </div>
              <div class="col-xs-10 col-sm-10 placeholder m-wraper-basicinfo">
                <div class="m-wrap-basicinfo row">
                  <div class="m-basicinfo-l col-sm-5">
{#                    <dl class="m-group-basicinfo">#}
{#                      <dt class="u-title-basicinfo">上传头像：</dt>#}
{#                      <dd class="u-cont-basicinfo">#}
{#                        <img src="../..{{ userdetail.avatar }}" class="u-head-img">#}
{#                      </dd>#}
{#                      <dd class="u-cont-basicinfo">#}
{#                          <p class="u-upload-picker">选择文件</p>#}
{#                          <form enctype="multipart/form-data" method="post" action="/teacher/upload/" id="testform" target="ifm">#}
{#                              <input type="hidden" name="userid" value="{{ userdetail.id }}">#}
{#                            <input type="file" name="imgFile" id="imgFile" accept="image/png,image/gif,image/jpg,image/gif,image/bmp">#}
{#                          </form>#}
{#                          <button class="u-upload btn btn-default">开始上传</button>#}
{#                          <iframe id='ifm' name='ifm' style="display:none" src="" class="m-pic-callback"></iframe>#}
{#                      </dd>#}
{#                    </dl>#}
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">学生姓名</dt>
                      <dd class="u-cont-basicinfo">{{ userdetail.realname }}</dd>
                    </dl>
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">年龄</dt>
                      <dd class="u-cont-basicinfo">{{ userdetail.age }}</dd>
                    </dl>
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">性别</dt>
                      <dd class="u-cont-basicinfo">
                      {% if userdetail.sex == 1 %}
                        女
                      {% elif userdetail.sex == 2 %}
                        男
                      {% else %}
                        其他
                      {% endif %}
                      </dd>
                    </dl>
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">年级</dt>
                      <dd class="u-cont-basicinfo">
                        {% if userdetail.grade == 1 %}
                            未入园
                        {% elif userdetail.grade == 2 %}
                            小班
                        {% elif userdetail.grade == 3 %}
                            中班
                        {% elif userdetail.grade == 4 %}
                            大班
                        {% elif userdetail.grade == 5 %}
                            一年级
                        {% elif userdetail.grade == 6 %}
                            二年级
                        {% elif userdetail.grade == 7 %}
                            三年级
                        {% elif userdetail.grade == 8 %}
                            四年级
                        {% elif userdetail.grade == 9 %}
                            五年级
                        {% elif userdetail.grade == 10 %}
                            六年级
                        {% elif userdetail.grade == 11 %}
                            初中
                        {% endif %}
                      </dd>
                    </dl>
                  </div>
                  <div class="m-basicinfo-r col-sm-7">
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">联系人</dt>
                      <dd class="u-cont-basicinfo">{{ userdetail.guardian }}</dd>
                    </dl>
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">与儿童关系</dt>
                      <dd class="u-cont-basicinfo">{{ userdetail.relationship }}</dd>
                    </dl>
                    <dl class="m-group-basicinfo">
                      <dt class="u-title-basicinfo">手机号</dt>
                      <dd class="u-cont-basicinfo">{{ userdetail.mobile }}</dd>
                    </dl>
                  </div>
                </div>
                <span class="u-modify-info u-btn-modify">信息有误，修改信息</span>
              </div>
              {# 修改档案弹框 start #}
{#              <div class="modal fade modal-teacher">#}
{#                <div class="modal-dialog">#}
{#                  <div class="modal-content">#}
{#                    <div class="modal-header">#}
{#                      <button class="close" data-dismiss="modal">×</button>#}
{#                      <h4>采集信息</h4>#}
{#                    </div>#}
{#                    <form class="form-horizontal form-new-stu" id="newtab">#}
{#                      <div class="modal-body">#}
{#                        <p class="u-tip"></p>#}
{#                        <div class="form-group">#}
{#                          <label for="user-real-name" class="col-sm-2 control-label">姓名<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <input type="text" class="form-control u-in realname" id="user-real-name" placeholder="姓名（请输入姓名）" name="realname" data-tip="请输入长度20以内个字符" value="{{ userdetail.realname }}">#}
{#                          </div>#}
{#                        </div>#}
{#                        <div class="form-group">#}
{#                          <label for="user-age" class="col-sm-2 control-label">年龄<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <input type="text" class="form-control u-in age" id="user-age" placeholder="年龄（1-100）" name="age"  data-tip="请输入1-100的数字" value="{{ userdetail.age }}">#}
{#                          </div>#}
{#                        </div>#}
{#                        <div class="form-group">#}
{#                          <label for="user-edu" class="col-sm-2 control-label">年级<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <select class="form-control" id="user-edu" name="education" >#}
{#                              <option value="0">请选择</option>#}
{#                              <option value="1" {% if userdetail.grade == 1 %}selected{% endif %}>未入园</option>#}
{#                              <option value="2" {% if userdetail.grade == 2 %}selected{% endif %}>小班</option>#}
{#                              <option value="3" {% if userdetail.grade == 3 %}selected{% endif %}>中班</option>#}
{#                              <option value="4" {% if userdetail.grade == 4 %}selected{% endif %}>大班</option>#}
{#                              <option value="5" {% if userdetail.grade == 5 %}selected{% endif %}>一年级</option>#}
{#                              <option value="6" {% if userdetail.grade == 6 %}selected{% endif %}>二年级</option>#}
{#                              <option value="7" {% if userdetail.grade == 7 %}selected{% endif %}>三年级</option>#}
{#                              <option value="8" {% if userdetail.grade == 8 %}selected{% endif %}>四年级</option>#}
{#                              <option value="9" {% if userdetail.grade == 9 %}selected{% endif %}>五年级</option>#}
{#                              <option value="10" {% if userdetail.grade == 10 %}selected{% endif %}>六年级</option>#}
{#                              <option value="11" {% if userdetail.grade == 11 %}selected{% endif %}>初中</option>#}
{#                            </select>#}
{#                          </div>#}
{#                        </div>#}
{#                        <div class="form-group">#}
{#                          <label for="user-contact" class="col-sm-2 control-label">联系人<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <input type="text" class="form-control u-in contact" id="user-contact" placeholder="联系人（请输入联系人）" name="guardian"  data-tip="（联系人）请输入20以内个字符" value="{{ userdetail.guardian }}">#}
{#                          </div>#}
{#                        </div>#}
{#                        <div class="form-group">#}
{#                          <label for="user-relation" class="col-sm-2 control-label">与儿童关系<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <input type="text" class="form-control u-in relation" id="user-relation" placeholder="与儿童关系（请输入与儿童关系）" name="relationship"  data-tip="（与儿童关系）请输入20以内个汉字" value="{{ userdetail.relationship }}">#}
{#                          </div>#}
{#                        </div>#}
{#                        <div class="form-group">#}
{#                          <label for="user-tel" class="col-sm-2 control-label">手机号<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <input type="text" class="form-control u-in tel" id="user-tel" placeholder="手机号（11位有效数字）" name="telephone"  data-tip="请输入正确的手机号" value="{{ userdetail.mobile }}">#}
{#                          </div>#}
{#                        </div>#}
{#                        <div class="form-group">#}
{#                          <label class="col-sm-2 control-label control-label">性别<span class="star-red">*</span></label>#}
{#                          <div class="col-sm-10">#}
{#                            <label for="user-gender-female" class="col-sm-3 control-label control-label-gender">#}
{#                              <input type="radio" class="" id="user-gender-female" name="gender" value="2" {% if userdetail.sex == 2 %}checked{% endif %}>#}
{#                              男</label>#}
{#                            <label for="user-gender-male" class="col-sm-3 control-label control-label-gender">#}
{#                              <input type="radio" class="" id="user-gender-male" name="gender" value="1" {% if userdetail.sex == 1 %}checked{% endif %}>#}
{#                              女</label>#}
{#                            <label for="user-gender-other" class="col-sm-3 control-label control-label-gender">#}
{#                              <input type="radio" class="" id="user-gender-other" name="gender" value="9" {% if userdetail.sex == 9 %}checked{% endif %}>#}
{#                              其他</label>#}
{#                          </div>#}
{#                        </div>#}
{#                        <div>#}
{#                          <input type="hidden" value="1" name="hand"/>#}
{#                          <input type="hidden" value="" name="birthday"/>#}
{#                          <input type="hidden" value="" name="access_token"/>#}
{#                          <input type="hidden" value="" name="path"/>#}
{#                          <input type="hidden" value="{{ userdetail.id }}" name="id" id="user-id"/>#}
{#                        </div>#}
{#                      </div>#}
{#                      <div class="modal-footer">#}
{#                        <button class="btn btn-default u-btn-cancel" data-dismiss="modal">取消</button>#}
{#                        <input type="submit" value="保存" class="btn btn-primary btn-save"/>#}
{#                      </div>#}
{#                    </form>#}
{#                  </div>#}
{#                </div>#}
{#              </div>#}
            {# 修改档案弹框 end #}
            </div>
        </div>
      </div>
      <div class="m-black-mask fn-hide"></div>
      <div class="row m-wrap-teacher">
        <div class="m-mask-teacher col-sm-9 fn-hide">
            <div class="modal-header m-header-teacher">
                  <button class="u-close-mask">×</button>
                  <h4 class="u-tlt-modal">采集信息</h4>
            </div>
            <form class="form-new-stu m-form-stu">
                <div class="m-wrap-bodym">
                    <div class="m-body-mask">
{#                    <p class="u-tip"></p>#}
                    <div class="form-group">
                          <label for="user-real-name" class="control-label m-label-modal">学生姓名<span class="star-red">*</span></label>
                          <div>
                            <input type="text" class="form-control u-in realname" id="user-real-name" name="realname" data-tip="请输入长度20以内个字符" value="{{ userdetail.realname }}">
                            <p class="u-tip-form"></p>
                          </div>
                        </div>
                    <div class="form-group">
                      <label class="control-label control-label m-label-modal">性别<span class="star-red">*</span></label>
                      <div class="m-wrap-sex clearfix">
                        <label for="user-gender-female" class="control-label-gender fn-left {% if userdetail.sex == 2 %}cur{% endif %}">男
                          <input type="radio" class="" id="user-gender-female" name="gender" value="2" {% if userdetail.sex == 2 %}checked{% endif %}>
                        </label>
                        <label for="user-gender-male" class="control-label-gender fn-left {% if userdetail.sex == 1 %}cur{% endif %}">女
                          <input type="radio" class="" id="user-gender-male" name="gender" value="1" {% if userdetail.sex == 1 %}checked{% endif %}>
                        </label>
                        <label for="user-gender-other" class="control-label-gender fn-left {% if userdetail.sex == 9 %}cur{% endif %}">其他
                          <input type="radio" class="" id="user-gender-other" name="gender" value="9" {% if userdetail.sex == 9 %}checked{% endif %}>
                        </label>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="user-age" class="control-label m-label-modal">年龄<span class="star-red">*</span></label>
                      <div>
                        <input type="text" class="form-control u-in age" id="user-age" name="age"  data-tip="请输入1-100的数字" value="{{ userdetail.age }}">
                        <p class="u-tip-form"></p>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="user-edu" class="control-label m-label-modal">年级<span class="star-red">*</span></label>
                      <div>
                        <select class="form-control" id="user-edu" name="education" >
                          <option value="1" {% if userdetail.grade == 1 %}selected{% endif %}>未入园</option>
                          <option value="2" {% if userdetail.grade == 2 %}selected{% endif %}>小班</option>
                          <option value="3" {% if userdetail.grade == 3 %}selected{% endif %}>中班</option>
                          <option value="4" {% if userdetail.grade == 4 %}selected{% endif %}>大班</option>
                          <option value="5" {% if userdetail.grade == 5 %}selected{% endif %}>一年级</option>
                          <option value="6" {% if userdetail.grade == 6 %}selected{% endif %}>二年级</option>
                          <option value="7" {% if userdetail.grade == 7 %}selected{% endif %}>三年级</option>
                          <option value="8" {% if userdetail.grade == 8 %}selected{% endif %}>四年级</option>
                          <option value="9" {% if userdetail.grade == 9 %}selected{% endif %}>五年级</option>
                          <option value="10" {% if userdetail.grade == 10 %}selected{% endif %}>六年级</option>
                          <option value="11" {% if userdetail.grade == 11 %}selected{% endif %}>初中</option>
                        </select>
                        <p class="u-tip-form"></p>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="user-contact" class="control-label m-label-modal">联系人<span class="star-red">*</span></label>
                      <div>
                        <input type="text" class="form-control u-in contact" id="user-contact" name="guardian"  data-tip="（联系人）请输入20以内个字符" value="{{ userdetail.guardian }}">
                        <p class="u-tip-form"></p>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="user-relation" class="control-label m-label-modal">与儿童关系<span class="star-red">*</span></label>
                      <div>
                        <input type="text" class="form-control u-in relation" id="user-relation" name="relationship"  data-tip="（与儿童关系）请输入20以内个汉字" value="{{ userdetail.relationship }}">
                        <p class="u-tip-form"></p>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="user-tel" class="control-label m-label-modal">手机号<span class="star-red">*</span></label>
                      <div>
                        <input type="text" class="form-control u-in tel" id="user-tel" name="telephone"  data-tip="请输入正确的手机号" value="{{ userdetail.mobile }}">
                        <p class="u-tip-form"></p>
                      </div>
                    </div>
                    <div>
                      <input type="hidden" value="1" name="hand"/>
                      <input type="hidden" value="" name="birthday"/>
                      <input type="hidden" value="" name="access_token"/>
                      <input type="hidden" value="" name="path"/>
                      <input type="hidden" value="{{ userdetail.id }}" name="id" id="user-id"/>
                    </div>
                  </div>
                </div>
                <div class="modal-footer clearfix m-mask-footer" style="padding-right: 30px;">
                    <input type="submit" value="保存" class="btn btn-save u-btn-mask fn-left"></input>
                    <button class="btn u-btn-cancel u-btn-mask fn-right">取消</button>
                </div>
            </form>
        </div>
      </div>
{% endblock %}
{% block script %}
    <script>
        seajs.use(['/static/js/app/student/collect',], function(collect){
            collect.init({
                access_token: 'input[name=access_token]',
                callb: '.m-pic-callback',
                form: '.form-new-stu',
                flag: 'collect'
            });
        })

{#    function changemsg() {#}
{#            id = $("#user-id").val();#}
{#            username = $("#user-name").val();#}
{#            age = $("#user-age").val();#}
{#            grade = $("#user-edu").val();#}
{#            sex = $("input[name='gender']:checked").val();#}
{#            guardian=$("#user-contact").val();#}
{#            relationship=$("#user-relation").val();#}
{#            mobile=$("#user-tel").val();#}
{#            $.ajax({#}
{#                type:'POST',#}
{#                url:'/teacher/collect/',#}
{#                dataType:'json',#}
{#                data:{#}
{#                    id: id,#}
{#                    username:username,#}
{#                    age:age,#}
{#                    grade:grade,#}
{#                    sex:sex,#}
{#                    guardian:guardian,#}
{#                    relationship:relationship,#}
{#                    mobile:mobile#}
{#                },#}
{#                success:function (response) {#}
{#                    console.log(response);#}
{#                }#}
{#            });#}
{#        }#}
    </script>
{% endblock %}